/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package upeu.edu.pe.modelo;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author YAKELYN
 */
@Entity
@Table(name = "SAU_EAP_FACULTAD")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "SauEapFacultad.findAll", query = "SELECT s FROM SauEapFacultad s"),
    @NamedQuery(name = "SauEapFacultad.findByIdEapFacultad", query = "SELECT s FROM SauEapFacultad s WHERE s.idEapFacultad = :idEapFacultad")})
public class SauEapFacultad implements Serializable {
    private static final long serialVersionUID = 1L;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Id
    @Basic(optional = false)
    @Column(name = "ID_EAP_FACULTAD")
    private BigDecimal idEapFacultad;
    @JoinColumn(name = "ID_FILIAL_FACULTAD", referencedColumnName = "ID_FILIAL_FACULTAD")
    @ManyToOne(optional = false)
    private SauFilialFacultad idFilialFacultad;
    @JoinColumn(name = "ID_EAP", referencedColumnName = "ID_EAP")
    @ManyToOne(optional = false)
    private SauEap idEap;
    @JoinColumn(name = "ID_COORDINADOR_EAP", referencedColumnName = "ID_COORDINADOR_EAP")
    @ManyToOne(optional = false)
    private SauCoordinadorEap idCoordinadorEap;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idEapFacultad")
    private Collection<SauEstandar> sauEstandarCollection;

    public SauEapFacultad() {
    }

    public SauEapFacultad(BigDecimal idEapFacultad) {
        this.idEapFacultad = idEapFacultad;
    }

    public BigDecimal getIdEapFacultad() {
        return idEapFacultad;
    }

    public void setIdEapFacultad(BigDecimal idEapFacultad) {
        this.idEapFacultad = idEapFacultad;
    }

    public SauFilialFacultad getIdFilialFacultad() {
        return idFilialFacultad;
    }

    public void setIdFilialFacultad(SauFilialFacultad idFilialFacultad) {
        this.idFilialFacultad = idFilialFacultad;
    }

    public SauEap getIdEap() {
        return idEap;
    }

    public void setIdEap(SauEap idEap) {
        this.idEap = idEap;
    }

    public SauCoordinadorEap getIdCoordinadorEap() {
        return idCoordinadorEap;
    }

    public void setIdCoordinadorEap(SauCoordinadorEap idCoordinadorEap) {
        this.idCoordinadorEap = idCoordinadorEap;
    }

    @XmlTransient
    public Collection<SauEstandar> getSauEstandarCollection() {
        return sauEstandarCollection;
    }

    public void setSauEstandarCollection(Collection<SauEstandar> sauEstandarCollection) {
        this.sauEstandarCollection = sauEstandarCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idEapFacultad != null ? idEapFacultad.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof SauEapFacultad)) {
            return false;
        }
        SauEapFacultad other = (SauEapFacultad) object;
        if ((this.idEapFacultad == null && other.idEapFacultad != null) || (this.idEapFacultad != null && !this.idEapFacultad.equals(other.idEapFacultad))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "upeu.edu.pe.modelo.SauEapFacultad[ idEapFacultad=" + idEapFacultad + " ]";
    }
    
}
